from django import forms
from django.forms import ClearableFileInput

from .models import ClientInfo, CertificationInfo


class CertificationGenerationForm(forms.Form):
    cert_file = forms.FileField(
        max_length=100,
        widget=ClearableFileInput(attrs={'accept': '.nesun.cert, .txt'}),
        label="选择授权码生成文件")
    duration = forms.IntegerField(min_value=1, label="授权时长")